package io.sousou.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import io.sousou.dao.StudentRepository;
import io.sousou.model.Student;
import io.sousou.service.StudentService;
@Service
public class StudentServiceImpl implements StudentService {
	
	@Autowired
	private StudentRepository studentRepository;

	@Override
	public List<Student> getAll() {
		return studentRepository.findAll();
	}

	@Override
	public void save(Student student) {
		studentRepository.save(student);
	}

	@Override
	public Student getOne(Integer id) {
		return studentRepository.findOne(id);
	}

	@Override
	public void update(Student student) {
		studentRepository.save(student);
	}
}
